﻿// -----------------------------------------------
// Author:     code34 nicolas_boiteux@yahoo.fr
// Edited by:  Neumatic
// Warcontext: On killed player event
// -----------------------------------------------

wcgarbage = _this spawn WC_fnc_garbagecollector;

[] call WC_fnc_saveloadout;

waitUntil {alive player};

wcrespawntobase = name player;
["wcrespawntobase", "server"] call WC_fnc_publicvariable;

switch (rank player) do {
	case "Private": {
		wcplayeraddscore = [player, -1];
	};

	case "Corporal": {
		wcplayeraddscore = [player, -2];
	};

	case "Sergeant": {
		wcplayeraddscore = [player, -3];
	};

	case "Lieutenant": {
		wcplayeraddscore = [player, -4];
	};

	case "Captain": {
		wcplayeraddscore = [player, -5];
	};

	case "Major": {
		wcplayeraddscore = [player, -7];
	};

	case "Colonel": {
		wcplayeraddscore = [player, -10];
	};
};

["wcplayeraddscore", "server"] call WC_fnc_publicvariable;

wcgarbage = [] spawn WC_fnc_clienthandler;

wcgarbage = [] spawn WC_fnc_restoreactionmenu;

wcgarbage = [] spawn WC_fnc_restoreloadout;